@model IEnumerable<ShivamEMR.Model.Domain.PharmacyDomain.DrugGeneric>

@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th></th>
        <th>
            Name
        </th>
        <th>
            Administration
        </th>
        <th>
            SpecialPrecautions
        </th>
        <th>
            AdverseDrugReactions
        </th>
        <th>
            Description
        </th>
        <th>
            Notes
        </th>
        <th>
            Category
        </th>
        <th>
            DrugClass
        </th>
        <th>
            Group
        </th>
        <th>
            Dosage
        </th>
        <th>
            ContraIndications
        </th>
        <th>
            Brands
        </th>
        <th>
            DrugInteractions1
        </th>
        <th>
            DrugInteractions2
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.ID }) |
            @Html.ActionLink("Details", "Details", new { id=item.ID }) |
            @Html.ActionLink("Delete", "Delete", new { id=item.ID })
        </td>
        <td>
			@item.Name
        </td>
        <td>
			@item.Administration
        </td>
        <td>
			@item.SpecialPrecautions
        </td>
        <td>
			@item.AdverseDrugReactions
        </td>
        <td>
			@item.Description
        </td>
        <td>
			@item.Notes
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Category).ToString()
        </td>
        <td>
			@(item.DrugClass == null ? "None" : item.DrugClass.Name)
        </td>
        <td>
			@Html.DisplayTextFor(_ => item.Group).ToString()
        </td>
        <td>
			@(item.Dosage == null ? "None" : item.Dosage.Count.ToString())
        </td>
        <td>
			@(item.ContraIndications == null ? "None" : item.ContraIndications.Count.ToString())
        </td>
        <td>
			@(item.Brands == null ? "None" : item.Brands.Count.ToString())
        </td>
        <td>
			@(item.DrugInteractions1 == null ? "None" : item.DrugInteractions1.Count.ToString())
        </td>
        <td>
			@(item.DrugInteractions2 == null ? "None" : item.DrugInteractions2.Count.ToString())
        </td>
    </tr>
}

</table>


